import React, { FC, useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { Button, Typography } from 'antd'
import { MANAGE_INDEX_PATHNAME } from '../router'
import axios from 'axios'
import styles from './Home.module.scss'

const { Title, Paragraph } = Typography
const Home: FC = () => {
  const nav = useNavigate()
  function clickHandle() {
    nav('/login')
  }

  useEffect(() => {
    // axios.get('/api/test').then(res => console.log(res.data))
  }, [])

  return (
    <div className={styles.container}>
      <div className={styles.info}>
        <Title>问卷调查 ｜ 在线投票</Title>
        <Paragraph>已累计创建 100 份，发布90份</Paragraph>
        <Button type="primary" onClick={() => nav(MANAGE_INDEX_PATHNAME)}>
          开始使用
        </Button>
      </div>
    </div>
  )
}

export default Home
